<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <link rel="stylesheet" href="../gameStyle.css" type="text/css" />
        <script type="text/javascript" src="http://lib.ivank.net/ivank.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
        <script type="text/javascript" src="types.js"></script>
        <script type="text/javascript" src="button.js"></script>
        <script type="text/javascript" src="timer.js"></script>
        <script type="text/javascript" src="level.js"></script>
    </head>
    <body onload="Start();">

        <canvas id ="canvas" width="750" height="500"></canvas>
        <script>            
            var canvas = document.getElementById("canvas");
            var cwidth = canvas.getAttribute("width");
            var cheight = canvas.getAttribute("height");
            
            
            function Start(){
                var stage = new Stage("canvas");
                var level = new FunctionsLevel(7,typePhysics);
                level.init();
                stage.addChild(level,0); // pridavam level na index 0, index tam inak nemusim davat
                intervalID = window.setInterval(level.run, 1000 / 60);  
            }
        
 
            var solved = false;
         
    
            
             function Functions(x,y,num){   
                Sprite.apply(this);
                this.num = num;
                this.picture;
                this.init = init;
                
                function init(){
                
                    ///
                    const IMAGE_URL= "../pictures/funct"+ this.num +".bmp";
                    var bitmapData = new BitmapData(IMAGE_URL);
                    this.picture = new Bitmap(bitmapData);
                    this.picture.x = x;
                    this.picture.y = y;
          
                    this.addChild(this.picture);     
                    
               
                }         
      
            }
            Functions.prototype = new Sprite();
          
                    
                    
            var len = 3;
            var size = 10;
            // LEVEL
            function FunctionsLevel(name, level, type){
                Sprite.apply(this); // dedim stage  
                Level.apply(this); // dedim level  
                this.name = name;
                this.level = level;
                this.type = type;
                this.canvas = canvas;
                // toto som pridal
                this.functions;
                // methodes
                this.init = init;
                this.click = click;
                this.move = move;
                
                // totok som zmenil
                function init(){
                    var x = cwidth/2 - len*size/2;
                    var y = cheight/2 - len*size/2;
                    this.functions= new Functions(x, y, 0);
                    this.functions.init(); 
                    this.addChild(this.functions);
                }
                
                function click(e){
                    // TODO
                    // e je typu event
                }
                
                function move(e){
                    // TODO
                }
                
                // toto neviem ako funguje presne, ale mozes to pridat aj
                // ku akemukolvek spritu, napriklad pre kazdy square
                this.addEventListener(MouseEvent.CLICK, this.click);
                this.addEventListener(MouseEvent.MOVE, this.move);
    
            }
            FunctionsLevel.prototype = new Sprite(); // toto musi byt  
            FunctionsLevel.prototype = new Level();
            
     
       
        </script>
        <script type="text/javascript" src="level.js"></script>
    </body>
</html>
-->